<!doctype html>
<html>
<head>
<meta charset="utf-8">
<script>
</script>
</head>
<body>

<div id="div1">
    <style type="text/css">p { color:red;}</style>
    <p><span>div</span>元素</p>
</div>
<script>
var div = document.getElementById("div1");
var s = div.innerHTML;
alert(s); 
</script>

</body>
</html>
